home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / dev / gui / gtlayout.lha / Source / LTP_LayoutGroup.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-09-09  |  17.0 KB  |  723 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1998 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16. VOID
  17. LTP_LayoutGroup(LayoutHandle *Handle,ObjectNode *Group)
  18. {
  19.     if(!Handle->Failed)
  20.     {
  21.         ObjectNode    *Node;
  22.         ObjectNode    *ReturnKey;
  23.         ObjectNode    *EscKey;
  24.         ObjectNode    *CursorKey;
  25.         ObjectNode    *TabKey;
  26.         ObjectNode    *ActiveString;
  27.         LONG         Left;
  28.         LONG         Top;
  29.         LONG         Width;
  30.         LONG         Height;
  31.         LONG         MaxWidth;
  32.         LONG         MaxHeight;
  33.         BOOL         DefaultCorrection;
  34.  
  35.         Left                = 0;
  36.         Top                    = 0;
  37.  
  38.         ReturnKey            = NULL;
  39.         EscKey                = NULL;
  40.         CursorKey            = NULL;
  41.         TabKey                = NULL;
  42.         ActiveString        = NULL;
  43.         DefaultCorrection    = FALSE;
  44.         MaxWidth            = 0;
  45.         MaxHeight            = 0;
  46.  
  47.         SCANGROUP(Group,Node)
  48.         {
  49.             LTP_DetermineSize(Handle,Node);
  50.  
  51.             switch(Node->Type)
  52.             {
  53.                 case BUTTON_KIND:
  54.  
  55.                     if(Node->Special.Button.ReturnKey)
  56.                         ReturnKey = Node;
  57.                     else
  58.                     {
  59.                         if(Node->Special.Button.EscKey)
  60.                             EscKey = Node;
  61.                     }
  62.  
  63.                     DefaultCorrection |= Node->Special.Button.DefaultCorrection;
  64.  
  65.                     break;
  66.  
  67.                 case CYCLE_KIND:
  68.  
  69.                     if(Node->Special.Cycle.TabKey)
  70.                         TabKey = Node;
  71.  
  72.                     break;
  73.  
  74.                 #ifdef DO_POPUP_KIND
  75.                 {
  76.                     case POPUP_KIND:
  77.  
  78.                         if(Node->Special.Popup.TabKey)
  79.                             TabKey = Node;
  80.  
  81.                         break;
  82.                 }
  83.                 #endif
  84.  
  85.                 #ifdef DO_TAB_KIND
  86.                 {
  87.                     case TAB_KIND:
  88.  
  89.                         if(Node->Special.Tab.TabKey)
  90.                             TabKey = Node;
  91.  
  92.                         break;
  93.                 }
  94.                 #endif
  95.  
  96.                 case MX_KIND:
  97.  
  98.                     if(Node->Special.Radio.TabKey)
  99.                         TabKey = Node;
  100.  
  101.                     break;
  102.  
  103.                 case PASSWORD_KIND:
  104.                 case STRING_KIND:
  105.                 case FRACTION_KIND:
  106.  
  107.                     if(Node->Special.String.Activate)
  108.                         ActiveString = Node;
  109.  
  110.                     break;
  111.  
  112.                 case INTEGER_KIND:
  113.  
  114.                     if(Node->Special.Integer.Activate)
  115.                         ActiveString = Node;
  116.  
  117.                     break;
  118.  
  119.                 case LISTVIEW_KIND:
  120.  
  121.                     if(Node->Special.List.CursorKey)
  122.                         CursorKey = Node;
  123.  
  124.                     break;
  125.             }
  126.  
  127.             if(Node->Width > MaxWidth)
  128.                 MaxWidth = Node->Width;
  129.  
  130.             if(Node->Height > MaxHeight)
  131.                 MaxHeight = Node->Height;
  132.         }
  133.  
  134.         if(ReturnKey || DefaultCorrection)
  135.         {
  136.             SCANGROUP(Group,Node)
  137.             {
  138.                 #ifdef OLD_STYLE_DEFAULT_KEY
  139.                 {
  140.                     Node->GroupIndent = TRUE;
  141.  
  142.                     Node->Width        += 4 + 4;
  143.                     Node->Height    += 2 + 2;
  144.                 }
  145.                 #else
  146.                 {
  147.                     Node->Width        += 1 + 1;
  148.                     Node->Height    += 1 + 1;
  149.                 }
  150.                 #endif
  151.  
  152.                 if(Node->Width > MaxWidth)
  153.                     MaxWidth = Node->Width;
  154.  
  155.                 if(Node->Height > MaxHeight)
  156.                     MaxHeight = Node->Height;
  157.             }
  158.         }
  159.  
  160.         if(Group->Special.Group.SameSize)
  161.         {
  162.             SCANGROUP(Group,Node)
  163.             {
  164.                 if(Node->Width < MaxWidth && Node->Type != YBAR_KIND && Node->Type != CHECKBOX_KIND)
  165.                 {
  166.                     if(Node->Type == GROUP_KIND)
  167.                     {
  168.                         if(!Node->Special.Group.NoIndent)
  169.                         {
  170.                             if(Node->Special.Group.AlignRight)
  171.                                 Node->Special.Group.ExtraLeft += MaxWidth - Node->Width;
  172.                             else
  173.                                 Node->Special.Group.ExtraLeft += (MaxWidth - Node->Width) / 2;
  174.                         }
  175.                     }
  176.  
  177.                     Node->Width = MaxWidth;
  178.                 }
  179.  
  180.                 if(Node->Height < MaxHeight && Node->Type != XBAR_KIND && Node->Type != CHECKBOX_KIND)
  181.                 {
  182.                     if(Node->Type == GROUP_KIND && !Node->Special.Group.NoIndent)
  183.                         Node->Special.Group.ExtraTop += (MaxHeight - Node->Height) / 2;
  184.  
  185.                     Node->Height = MaxHeight;
  186.                 }
  187.             }
  188.         }
  189.  
  190.         if(Group->Special.Group.Horizontal)
  191.         {
  192.             LONG x,y,w,MaxTop = 0,MaxWidth = 0,MaxHeight = 0,Count = 0;
  193.  
  194.             if(Group->Node.mln_Pred->mln_Pred && Group->Special.Group.LastAttributes)
  195.             {
  196.                 ObjectNode *LastGroup = (ObjectNode *)Group->Node.mln_Pred;
  197.  
  198.                 MaxTop        = LastGroup->Special.Group.MaxOffset;
  199.                 MaxHeight    = LastGroup->Special.Group.MaxSize;
  200.             }
  201.  
  202.             SCANGROUP(Group,Node)
  203.             {
  204.                 if(!LIKE_STRING_KIND(Node) || Node->Special.String.LinkID == -1)
  205.                 {
  206.                     if(!Group->Special.Group.Paging && Count++)
  207.                     {
  208.                         if(Node->ExtraSpace > 0)
  209.                             x = Left + Node->ExtraSpace * Handle->InterWidth;
  210.                         else
  211.                         {
  212.                             if(Node->ExtraSpace < 0)
  213.                                 x = Left - Node->ExtraSpace;
  214.                             else
  215.                                 x = Left + Node->LayoutSpace * Handle->InterWidth;
  216.                         }
  217.                     }
  218.                     else
  219.                         x = Left;
  220.  
  221.                     y = Top;
  222.                     w = Node->Width;
  223.  
  224.                     switch(Node->LabelPlace)
  225.                     {
  226.                         case PLACE_LEFT:
  227.  
  228.                             if(Node->Type == MX_KIND)
  229.                             {
  230.                                 x += Node->Special.Radio.LabelWidth + INTERWIDTH;
  231.  
  232.                                 if(Node->Label)
  233.                                 {
  234.                                     if(Node->Special.Radio.TitlePlace == PLACETEXT_LEFT)
  235.                                         x += Node->LabelWidth + INTERWIDTH;
  236.                                     else
  237.                                         w += INTERWIDTH + Node->LabelWidth;
  238.                                 }
  239.                             }
  240.                             else
  241.                             {
  242.                                 if(Node->Label || (Node->Type == BOX_KIND && Node->Special.Box.Labels))
  243.                                     x += Node->LabelWidth + INTERWIDTH;
  244.                             }
  245.  
  246.                             break;
  247.  
  248.                         case PLACE_RIGHT:
  249.  
  250.                             if(Node->Type == MX_KIND)
  251.                             {
  252.                                 w += INTERWIDTH + Node->Special.Radio.LabelWidth;
  253.  
  254.                                 if(Node->Label)
  255.                                 {
  256.                                     if(Node->Special.Radio.TitlePlace == PLACETEXT_LEFT)
  257.                                         x += Node->LabelWidth + INTERWIDTH;
  258.                                     else
  259.                                         w += INTERWIDTH + Node->LabelWidth;
  260.                                 }
  261.                             }
  262.                             else
  263.                             {
  264.                                 if(Node->Label || (Node->Type == BOX_KIND && Node->Special.Box.Labels))
  265.                                     w += INTERWIDTH + Node->LabelWidth;
  266.                             }
  267.  
  268.                             break;
  269.  
  270.                         case PLACE_ABOVE:
  271.  
  272.                             if(Node->Label || (Node->Type == BOX_KIND && Node->Special.Box.Labels))
  273.                             {
  274.                                 if(Node->Type == LISTVIEW_KIND && Node->Special.List.TextAttr && Node->Special.List.FlushLabelLeft)
  275.                                     y += Node->Special.List.FixedGlyphHeight + INTERHEIGHT;
  276.                                 else
  277.                                     y += Handle->GlyphHeight + INTERHEIGHT;
  278.                             }
  279.  
  280.                             break;
  281.                     }
  282.  
  283.                     if(Node->Type == SLIDER_KIND)
  284.                     {
  285.                         if(Node->Special.Slider.LevelPlace == PLACETEXT_RIGHT && Node->Special.Slider.LevelFormat)
  286.                             w += INTERWIDTH + Node->Special.Slider.LevelWidth;
  287.  
  288.                         if(Node->Special.Slider.LevelPlace == PLACETEXT_LEFT && Node->LabelPlace != PLACE_LEFT && Node->Special.Slider.LevelFormat)
  289.                             x += INTERWIDTH + Node->Special.Slider.LevelWidth;
  290.                     }
  291.  
  292.                     #ifdef DO_LEVEL_KIND
  293.                     {
  294.                         if(Node->Type == LEVEL_KIND)
  295.                         {
  296.                             if(Node->Special.Level.LevelFormat != NULL)
  297.                             {
  298.                                 if(Node->Special.Level.LevelPlace == PLACETEXT_RIGHT)
  299.                                     w += INTERWIDTH + Node->Special.Level.MaxLevelWidth;
  300.  
  301.                                 if(Node->Special.Level.LevelPlace == PLACETEXT_LEFT && Node->LabelPlace != PLACE_LEFT)
  302.                                     x += INTERWIDTH + Node->Special.Level.MaxLevelWidth;
  303.                             }
  304.                         }
  305.                     }
  306.                     #endif    /* DO_LEVEL_KIND */
  307.  
  308.                     if(Node->Type == LISTVIEW_KIND && Node->Special.List.ExtraLabelWidth)
  309.                         x += Node->Special.List.ExtraLabelWidth + INTERWIDTH;
  310.  
  311.                     if(y > MaxTop)
  312.                         MaxTop = y;
  313.  
  314.                     if(Node->Height > MaxHeight)
  315.                         MaxHeight = Node->Height;
  316.  
  317.                     if(Node->LabelPlace == PLACE_BELOW && Node->Label)
  318.                     {
  319.                         LONG Height;
  320.  
  321.                         if(Node->Type == LISTVIEW_KIND && Node->Special.List.TextAttr && Node->Special.List.FlushLabelLeft)
  322.                             Height = Node->Height + INTERHEIGHT + Node->Special.List.FixedGlyphHeight;
  323.                         else
  324.                             Height = Node->Height + INTERHEIGHT + Handle->GlyphHeight;
  325.  
  326.                         if(Height > MaxHeight)
  327.                             MaxHeight = Height;
  328.                     }
  329.                     else
  330.                     {
  331.                         if(Node->Height > MaxHeight)
  332.                             MaxHeight = Node->Height;
  333.                     }
  334.  
  335.                     if(x + w > MaxWidth)
  336.                         MaxWidth = x+w;
  337.  
  338.                     Node->Left = x;
  339.  
  340.                     if(!Group->Special.Group.Paging)
  341.                         Left = x + w;
  342.                 }
  343.             }
  344.  
  345.             SCANGROUP(Group,Node)
  346.             {
  347.                 if(!LIKE_STRING_KIND(Node) || Node->Special.String.LinkID == -1)
  348.                 {
  349.                     Node->Top = MaxTop;
  350.  
  351.                     if(Node->Type == GROUP_KIND)
  352.                         Node->Special.Group.ExtraTop += MaxTop - Top;
  353.  
  354.                     if(Node->Height < MaxHeight)
  355.                     {
  356.                         register BOOL CanChangeHeight;
  357.  
  358.                         #ifdef DO_BOOPSI_KIND
  359.                         {
  360.                             CanChangeHeight = (BOOL)(    (Node->Type == PALETTE_KIND && !Node->Special.Palette.UsePicker) ||
  361.                                                         (Node->Type == LISTVIEW_KIND) ||
  362.                                                         (Node->Type == BOOPSI_KIND && !Node->Special.BOOPSI.ExactHeight)
  363.                                                     );
  364.                         }
  365.                         #else
  366.                         {
  367.                             CanChangeHeight = (BOOL)(    (Node->Type == PALETTE_KIND && !Node->Special.Palette.UsePicker) ||
  368.                                                         (Node->Type == LISTVIEW_KIND)
  369.                                                     );
  370.                         }
  371.                         #endif    /* DO_BOOPSI_KIND */
  372.  
  373.                         if(CanChangeHeight)
  374.                         {
  375.                             Node->Height = MaxHeight;
  376.                         }
  377.                         else
  378.                         {
  379.                             if(Node->Type == GROUP_KIND)
  380.                             {
  381.                                 if(Node->Special.Group.Spread)
  382.                                 {
  383.                                     LTP_Spread(Handle,Node,Node->Width,MaxHeight);
  384.                                 }
  385.                                 else
  386.                                 {
  387.                                     if(!Node->Special.Group.NoIndent)
  388.                                         Node->Special.Group.ExtraTop += (MaxHeight - Node->Height) / 2; /* !FIX! */
  389.                                 }
  390.  
  391.                                 Node->Height = MaxHeight;
  392.                             }
  393.                         }
  394.                     }
  395.                 }
  396.             }
  397.  
  398.             Group->Special.Group.MaxOffset = MaxTop;
  399.             Group->Special.Group.MaxSize   = MaxHeight;
  400.  
  401.             if(Group->Special.Group.Paging)
  402.                 Width = MaxWidth;
  403.             else
  404.                 Width = Left;
  405.  
  406.             Height = MaxTop + MaxHeight;
  407.         }
  408.         else
  409.         {
  410.             LONG x,y,w,MaxLeft = 0,MaxWidth = 0,MaxHeight = 0,Count = 0;
  411.  
  412.             if(Group->Node.mln_Pred->mln_Pred && Group->Special.Group.LastAttributes)
  413.             {
  414.                 ObjectNode *LastGroup = (ObjectNode *)Group->Node.mln_Pred;
  415.  
  416.                 MaxLeft     = LastGroup->Special.Group.MaxOffset;
  417.                 MaxWidth    = LastGroup->Special.Group.MaxSize;
  418.             }
  419.  
  420.             SCANGROUP(Group,Node)
  421.             {
  422.                 if(!LIKE_STRING_KIND(Node) || Node->Special.String.LinkID == -1)
  423.                 {
  424.                     if(!Group->Special.Group.Paging && Count++)
  425.                     {
  426.                         if(Node->ExtraSpace > 0)
  427.                             y = Top + Node->ExtraSpace * Handle->InterHeight;
  428.                         else
  429.                         {
  430.                             if(Node->ExtraSpace < 0)
  431.                                 y = Top - Node->ExtraSpace;
  432.                             else
  433.                                 y = Top + Node->LayoutSpace * Handle->InterHeight;
  434.                         }
  435.                     }
  436.                     else
  437.                         y = Top;
  438.  
  439.                     w = Node->Width;
  440.                     x = Left;
  441.  
  442.                     switch(Node->LabelPlace)
  443.                     {
  444.                         case PLACE_LEFT:
  445.  
  446.                             if(Node->Type == MX_KIND)
  447.                             {
  448.                                 x += Node->Special.Radio.LabelWidth + INTERWIDTH;
  449.  
  450.                                 if(Node->Label)
  451.                                 {
  452.                                     if(Node->Special.Radio.TitlePlace == PLACETEXT_LEFT)
  453.                                         x += Node->LabelWidth + INTERWIDTH;
  454.                                 }
  455.                             }
  456.                             else
  457.                             {
  458.                                 if(Node->Label || (Node->Type == BOX_KIND && Node->Special.Box.Labels))
  459.                                     x += Node->LabelWidth + INTERWIDTH;
  460.                             }
  461.  
  462.                             break;
  463.  
  464.                         case PLACE_RIGHT:
  465.  
  466.                             if(Node->Type == MX_KIND)
  467.                             {
  468.                                 w += INTERWIDTH + Node->Special.Radio.LabelWidth;
  469.  
  470.                                 if(Node->Label)
  471.                                 {
  472.                                     if(Node->Special.Radio.TitlePlace == PLACETEXT_LEFT)
  473.                                         x += Node->LabelWidth + INTERWIDTH;
  474.                                     else
  475.                                         w += INTERWIDTH + Node->LabelWidth;
  476.                                 }
  477.                             }
  478.                             else
  479.                             {
  480.                                 if(Node->Label || (Node->Type == BOX_KIND && Node->Special.Box.Labels))
  481.                                     w += INTERWIDTH + Node->LabelWidth;
  482.                             }
  483.  
  484.                             break;
  485.  
  486.                         case PLACE_ABOVE:
  487.  
  488.                             if(Node->Label || (Node->Type == BOX_KIND && Node->Special.Box.Labels))
  489.                             {
  490.                                 if(Node->Type == LISTVIEW_KIND && Node->Special.List.TextAttr && Node->Special.List.FlushLabelLeft)
  491.                                     y += Node->Special.List.FixedGlyphHeight + INTERHEIGHT;
  492.                                 else
  493.                                     y += Handle->GlyphHeight + INTERHEIGHT;
  494.                             }
  495.  
  496.                             break;
  497.                     }
  498.  
  499.                     if(Node->Type == SLIDER_KIND)
  500.                     {
  501.                         if(Node->Special.Slider.LevelPlace == PLACETEXT_RIGHT && Node->Special.Slider.LevelFormat)
  502.                             w += INTERWIDTH + Node->Special.Slider.LevelWidth;
  503.  
  504.                         if(Node->Special.Slider.LevelPlace == PLACETEXT_LEFT && Node->LabelPlace != PLACE_LEFT && Node->Special.Slider.LevelFormat)
  505.                             x += INTERWIDTH + Node->Special.Slider.LevelWidth;
  506.                     }
  507.  
  508.                     #ifdef DO_LEVEL_KIND
  509.                     {
  510.                         if(Node->Type == LEVEL_KIND)
  511.                         {
  512.                             if(Node->Special.Level.LevelFormat != NULL)
  513.                             {
  514.                                 if(Node->Special.Level.LevelPlace == PLACETEXT_RIGHT)
  515.                                     w += INTERWIDTH + Node->Special.Level.MaxLevelWidth;
  516.  
  517.                                 if(Node->Special.Level.LevelPlace == PLACETEXT_LEFT && Node->LabelPlace != PLACE_LEFT)
  518.                                     x += INTERWIDTH + Node->Special.Level.MaxLevelWidth;
  519.                             }
  520.                         }
  521.                     }
  522.                     #endif    /* DO_LEVEL_KIND */
  523.  
  524.                     if(Node->Type == LISTVIEW_KIND && Node->Special.List.ExtraLabelWidth)
  525.                         x += Node->Special.List.ExtraLabelWidth + INTERWIDTH;
  526.  
  527.                     if(x > MaxLeft)
  528.                         MaxLeft = x;
  529.  
  530.                     if(w > MaxWidth)
  531.                         MaxWidth = w;
  532.  
  533.                     if(y + Node->Height > MaxHeight)
  534.                         MaxHeight = y + Node->Height;
  535.  
  536.                     Node->Top = y;
  537.  
  538.                     if(!Group->Special.Group.Paging)
  539.                         Top = y + Node->Height;
  540.  
  541.                     if(Node->LabelPlace == PLACE_BELOW && Node->Label)
  542.                     {
  543.                         if(Node->Type == LISTVIEW_KIND && Node->Special.List.TextAttr && Node->Special.List.FlushLabelLeft)
  544.                             Top += INTERHEIGHT + Node->Special.List.FixedGlyphHeight;
  545.                         else
  546.                             Top += INTERHEIGHT + Handle->GlyphHeight;
  547.                     }
  548.                 }
  549.             }
  550.  
  551.             SCANGROUP(Group,Node)
  552.             {
  553.                 if(!LIKE_STRING_KIND(Node) || Node->Special.String.LinkID == -1)
  554.                 {
  555.                     Node->Left = MaxLeft;
  556.  
  557.                     if(Node->Type == GROUP_KIND)
  558.                     {
  559.                         if(Group->Special.Group.Paging && !Node->Special.Group.NoIndent)
  560.                             Node->Special.Group.ExtraTop += (MaxHeight - Node->Height) / 2;
  561.  
  562.                         Node->Special.Group.ExtraLeft += MaxLeft - Left;
  563.                     }
  564.  
  565.                     if(Node->Width < MaxWidth)
  566.                     {
  567.                         if(Node->Type == GROUP_KIND)
  568.                         {
  569.                             if(Node->Special.Group.Spread)
  570.                                 LTP_Spread(Handle,Node,MaxWidth,Node->Height);
  571.                             else
  572.                             {
  573.                                 if(!Node->Special.Group.NoIndent)
  574.                                 {
  575.                                     if(Node->Special.Group.AlignRight)
  576.                                         Node->Special.Group.ExtraLeft += MaxWidth - Node->Width;
  577.                                     else
  578.                                         Node->Special.Group.ExtraLeft += (MaxWidth - Node->Width) / 2;
  579.                                 }
  580.                             }
  581.  
  582.                             Node->Width = MaxWidth;
  583.                         }
  584.                         else
  585.                         {
  586.                             register BOOL CanChangeWidth;
  587.  
  588.                             #ifdef DO_BOOPSI_KIND
  589.                             {
  590.                                 CanChangeWidth = (BOOL)(    (Node->Type == LISTVIEW_KIND && !Node->Special.List.LockSize) ||
  591.                                                             (Node->Type == PALETTE_KIND && !Node->Special.Palette.UsePicker) ||
  592.                                                             (Node->Type == TEXT_KIND && !Node->Special.Text.LockSize) ||
  593.                                                             (LIKE_STRING_KIND(Node)) ||
  594.                                                             (Node->Type == BLANK_KIND) ||
  595.                                                             (Node->Type == BOX_KIND) ||
  596.                                                             (Node->Type == BUTTON_KIND) ||
  597.                                                             (Node->Type == CYCLE_KIND) ||
  598.                                                             (Node->Type == GAUGE_KIND) ||
  599.                                                             (Node->Type == INTEGER_KIND) ||
  600.                                                             (Node->Type == NUMBER_KIND) ||
  601.                                                             (Node->Type == SCROLLER_KIND) ||
  602.                                                             (Node->Type == SLIDER_KIND) ||
  603.                                                             (Node->Type == BOOPSI_KIND && !Node->Special.BOOPSI.ExactWidth) ||
  604.                                                             (Node->Type == LEVEL_KIND) ||
  605.                                                             (Node->Type == POPUP_KIND) ||
  606.                                                             (Node->Type == TAB_KIND)
  607.                                                         );
  608.                             }
  609.                             #else
  610.                             {
  611.                                 CanChangeWidth = (BOOL)(    (Node->Type == LISTVIEW_KIND && !Node->Special.List.LockSize) ||
  612.                                                             (Node->Type == PALETTE_KIND && !Node->Special.Palette.UsePicker) ||
  613.                                                             (Node->Type == TEXT_KIND && !Node->Special.Text.LockSize) ||
  614.                                                             (LIKE_STRING_KIND(Node)) ||
  615.                                                             (Node->Type == BLANK_KIND) ||
  616.                                                             (Node->Type == BOX_KIND) ||
  617.                                                             (Node->Type == BUTTON_KIND) ||
  618.                                                             (Node->Type == CYCLE_KIND) ||
  619.                                                             (Node->Type == GAUGE_KIND) ||
  620.                                                             (Node->Type == INTEGER_KIND) ||
  621.                                                             (Node->Type == NUMBER_KIND) ||
  622.                                                             (Node->Type == SCROLLER_KIND) ||
  623.                                                             (Node->Type == SLIDER_KIND)
  624.                                                         );
  625.                             }
  626.                             #endif    /* DO_BOOPSI_KIND */
  627.  
  628.                             if(CanChangeWidth)
  629.                             {
  630.                                 if(Node->Label && Node->LabelPlace == PLACE_RIGHT)
  631.                                     Node->Width = MaxWidth - (INTERWIDTH + Node->LabelWidth);
  632.                                 else
  633.                                     Node->Width = MaxWidth;
  634.                             }
  635.                         }
  636.                     }
  637.                 }
  638.             }
  639.  
  640.             Group->Special.Group.MaxOffset  = MaxLeft;
  641.             Group->Special.Group.MaxSize    = MaxWidth;
  642.  
  643.             if(Group->Special.Group.Paging)
  644.                 Height = MaxHeight;
  645.             else
  646.                 Height = Top;
  647.  
  648.             Width = MaxLeft + MaxWidth;
  649.         }
  650.  
  651.         Group->Left        = 0;
  652.         Group->Top        = 0;
  653.         Group->Width    = Width;
  654.         Group->Height    = Height;
  655.  
  656.         if(Group->Label || Group->Special.Group.Frame || Group->Special.Group.FrameType != FRAMETYPE_None)
  657.         {
  658.             if(Group->Label)
  659.             {
  660.                 Group->LabelWidth = LT_LabelWidth(Handle,Group->Label) + 2 * Handle->GlyphWidth;
  661.  
  662.                 Group->Height += Handle->GlyphHeight + 2 * Handle->InterHeight + 3;
  663.             }
  664.             else
  665.             {
  666.                 Group->LabelWidth = 0;
  667.  
  668.                 Group->Height += 2 + 2 * Handle->InterHeight + 3;
  669.             }
  670.  
  671.             if(Group->LabelWidth > Group->Width)
  672.             {
  673.                 if(!Node->Special.Group.NoIndent)
  674.                 {
  675.                     if(Node->Special.Group.AlignRight)
  676.                         Group->Special.Group.ExtraLeft += Group->LabelWidth - Group->Width;
  677.                     else
  678.                         Group->Special.Group.ExtraLeft += (Group->LabelWidth - Group->Width) / 2;
  679.                 }
  680.  
  681.                 Group->Width = Group->LabelWidth;
  682.             }
  683.             else
  684.             {
  685.                 if(Group->Special.Group.FrameType == FRAMETYPE_Tab)
  686.                 {
  687.                     Group->Special.Group.ExtraLeft += Handle->GlyphWidth;
  688.                     Group->Width += 2 * Handle->GlyphWidth;
  689.                 }
  690.             }
  691.  
  692.             Group->Width += 2 * (Handle->GlyphWidth + Handle->InterWidth) + 8;
  693.         }
  694.  
  695.         if(Group->Special.Group.IndentX)
  696.         {
  697.             Group->Width                    += 2 * Handle->InterWidth;
  698.             Group->Special.Group.ExtraLeft    += Handle->InterWidth;
  699.         }
  700.  
  701.         if(Group->Special.Group.IndentY)
  702.         {
  703.             Group->Height                    += 2 * Handle->InterHeight;
  704.             Group->Special.Group.ExtraTop    += Handle->InterHeight;
  705.         }
  706.  
  707.         if(ReturnKey)
  708.             Handle->ReturnKey = ReturnKey;
  709.  
  710.         if(EscKey)
  711.             Handle->EscKey = EscKey;
  712.  
  713.         if(CursorKey)
  714.             Handle->CursorKey = CursorKey;
  715.  
  716.         if(TabKey)
  717.             Handle->TabKey = TabKey;
  718.  
  719.         if(ActiveString)
  720.             Handle->ActiveString = ActiveString;
  721.     }
  722. }
  723.